package com.wc.alorithm_luogu.P5725;

import java.util.Scanner;

/**
 * @Author congge
 * @Date 2023/4/20 13:08
 * @description https://www.luogu.com.cn/problem/P5725
 * 求三角形
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();

        int num = 1;
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                if (num < 10) {
                    System.out.print("0" + num);
                } else {
                    System.out.print(num);
                }
                num++;
            }
            System.out.println();
        }

        System.out.println();

        num = 1;

        for (int i = 0; i < n; i++) {
            // 输出空格
            for (int j = 0; j < n - i - 1; j++) {
                System.out.print("  ");
            }
            for (int j = 0; j <= i; j++) {
                if (num < 10) {
                    System.out.print("0" + num);
                } else {
                    System.out.print(num);
                }
                num++;
            }
            System.out.println();
        }
    }
}
